With the development of the Internet, a user can perform various input by using various mobile devices at any time and any place, for example, input a password for logging in to an instant messaging tool, and the user completes an operation of inputting the password by using a password input box of the instant messaging tool, so as to trigger a key input event in the password input box.
However, security problems related to various characters input by a user emerge one after another, and a manner of stealing a character obtained from the key input event in a system develops from manners such as a simple fake box manner to a stealing manner of memory interception and capturing that is highly technical.
To prevent an input character from being stolen, an application can load a customized keyboard when a user triggers an input operation, and take over a procedure of processing the key input event in a system. However, the customized keyboard has a compatibility problem, and the customized keyboard is no longer functional after malicious code is injected into the application.
In addition, the system may also intercept an input character by using a key input event callback function, so as to perform various encryption processing on the input character; however, because an intercepting point is a public interface of the system, and is at the end of a procedure of processing a key event by the system, the intercepting point is easily used by a destructor.
Therefore, processing on various key input events in an application has a security limitation, so that password security of an application program of a mobile terminal is not high.